﻿using AnesSystem.Models;
using AnesSystem.Services;
using AnesSystem.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// UrgentOperCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class UrgentOperCtrl : UserControl
    {
        #region Variables

        #endregion

        #region Constructor
        public UrgentOperCtrl()
        {
            InitializeComponent();
            this.Loaded += UrgentOperCtrl_Loaded;
        }
        #endregion

        #region Properties

        #endregion

        #region 依赖属性



        #endregion

        #region Event

        #endregion

        #region Private Methods
        private void UrgentOperCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            UrgentOperDialogWin UrgentWin = new UrgentOperDialogWin();
            UrgentOperDialogWinViewModel.Instance.UrgentWin = UrgentWin;
            UrgentWin.ShowDialog();

            //if (MessageBoxCommon.ShowDialog("是否确定新建急诊手术？", MessageBoxCommon.OKCANCLE).Value == true)
            //{
            //    PatientLinkModel patientLink = new PatientLinkModel();
            //    patientLink.CreateDate = DateTime.Now;
            //    patientLink.Schedule.Pbssjh = DataManager.Instance.CurRoom.Name;
            //    patientLink.Schedule.Jhsssj = DateTime.Now;
            //    patientLink.Patient.Status = "valid";
            //    patientLink.Application.Type = Constants.OR_TYPE_URGENT;
            //    patientLink.Application.Detailstatus = Constants.OR_STATUS_FLAG_SCHEDULED;
            //    PatientLinkService.Instance.AddUpdate(patientLink);
            //    DataManager.Instance.CurrentPatientLink = patientLink;
            //    MainPageCommonViewModel.Instance.NavigateTo("AnesRecordCtrl", patientLink.Id.ToString());
            //}
            //else
            //{
            //    MainPageCommonViewModel.Instance.NavigateTo("XuanZeShouShuCtrl");
            //}

        }
        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion



    }
}
